#include<iostream>
using namespace std;
class Strategy {
public:
    virtual void Algorithm() = 0;
};

class StrategyA: public Strategy
{
public:
    void Algorithm() override
    {
        cout << "strategy A" << endl;
    }
};

class StrategyB: public Strategy
{
public:
    void Algorithm() override
    {
        cout << "strategy B" << endl;
    }
};

class Context
{
public:
    void SetStrategy(Strategy *init)
    {
        st = init;
    }
    void ContextInterface()
    {
        st->Algorithm();
    }
private:
    Strategy *st;
};


int main(int argc, char* argv[])
{
    Context ctx;
    ctx.SetStrategy(new StrategyA());
    ctx.ContextInterface();
}